






#ifndef __KEYSWEEP_H
#define __KEYSWEEP_H


#define LOW   (0)
#define HIGH  (1)


#define KEY1_VALUE_MASK				(0x20030)
#define KEY2_VALUE_MASK				(0x0c)

#define ROW1_VALUE					(0x00010)
#define ROW2_VALUE					(0x00020)
#define ROW3_VALUE					(0x00004)
#define ROW4_VALUE					(0x00008)
#define ROW5_VALUE					(0x20000)


//KEY  SWEEP  SET
#define KEY_LINE_0_CONNECTED_PORT		(0)
#define KEY_LINE_0_CONNECTED_PIN		(20)
#define KEY_LINE_0_CONNECTED_MASK		(1 << KEY_LINE_0_CONNECTED_PIN)

#define KEY_LINE_1_CONNECTED_PORT		(0)
#define KEY_LINE_1_CONNECTED_PIN		(21)
#define KEY_LINE_1_CONNECTED_MASK		(1 << KEY_LINE_1_CONNECTED_PIN)

#define KEY_LINE_2_CONNECTED_PORT		(0)
#define KEY_LINE_2_CONNECTED_PIN		(22)
#define KEY_LINE_2_CONNECTED_MASK		(1 << KEY_LINE_2_CONNECTED_PIN)

#define KEY_SWEEP_0_CONNECTED_PORT		(0)
#define KEY_SWEEP_0_CONNECTED_PIN		(4)
#define KEY_SWEEP_0_CONNECTED_MASK		(1 << KEY_SWEEP_0_CONNECTED_PIN)

#define KEY_SWEEP_1_CONNECTED_PORT		(0)
#define KEY_SWEEP_1_CONNECTED_PIN		(5)
#define KEY_SWEEP_1_CONNECTED_MASK		(1 << KEY_SWEEP_1_CONNECTED_PIN)

#define KEY_SWEEP_2_CONNECTED_PORT		(5)
#define KEY_SWEEP_2_CONNECTED_PIN		(2)
#define KEY_SWEEP_2_CONNECTED_MASK		(1 << KEY_SWEEP_2_CONNECTED_PIN)

#define KEY_SWEEP_3_CONNECTED_PORT		(5)
#define KEY_SWEEP_3_CONNECTED_PIN		(3)
#define KEY_SWEEP_3_CONNECTED_MASK		(1 << KEY_SWEEP_3_CONNECTED_PIN)

#define KEY_SWEEP_4_CONNECTED_PORT		(0)
#define KEY_SWEEP_4_CONNECTED_PIN		(17)
#define KEY_SWEEP_4_CONNECTED_MASK		(1 << KEY_SWEEP_4_CONNECTED_PIN)

#define KEY_LED_0_CONNECTED_PORT		(0)
#define KEY_LED_0_CONNECTED_PIN			(15)
#define KEY_LED_0_CONNECTED_MASK		(1 << KEY_SWEEP_4_CONNECTED_PIN)

#define KEY_LED_1_CONNECTED_PORT		(0)
#define KEY_LED_1_CONNECTED_PIN			(16)
#define KEY_LED_1_CONNECTED_MASK		(1 << KEY_SWEEP_4_CONNECTED_PIN)

/****************************************************/

extern uint64_t get_key(void);
extern void key_init(void);

#endif
